home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / FTPGet1_1.lha / FTPGet1_1 / FTPGet.DOC < prev    next >
Text File  |  1995-03-01  |  17KB  |  389 lines

  1.  
  2.                             FTPGet v1.1
  3.  
  4.                       Automatic FTP for AmiTCP
  5.  
  6.                          © 1995 Simon Dainty
  7.  
  8.             -={ Dedicated to Katrina Finch - IRC: KaT }=-
  9.  
  10. ======================================================================
  11.   Contents:                                              FTPGet v1.1
  12. ======================================================================
  13.  
  14.   Introduction: What is...?                                      1.0
  15.  
  16.   FTPGet:                                                        2.0
  17.     Installation ............................................... 2.1
  18.     How to...? ................................................. 2.2
  19.     Problems, problems ......................................... 2.3
  20.  
  21.   Legalities... damn:                                            3.0
  22.  
  23.   ...Forty Two:                                                  4.0
  24.     A word in your shell-like .................................. 4.1
  25.     Past, present and future ................................... 4.2
  26.  
  27. ======================================================================
  28.   Introduction: What is...?                              Chapter 1.0
  29. ======================================================================
  30.  
  31. The  norm, where  FTP is an  issue is  to  boot a shell-based, or GUI-
  32. based, FTP client and perform  any actions manually, whilst  connected
  33. to a  FTP site.  From the  FTP client you can  remotely transfer files
  34. in both directions  and wander through the site's  directory hierarchy
  35. at your  leisure.  Excellent if  you're browsing, but  time  consuming
  36. and often costly if you pay for your Internet access.
  37.  
  38.   With  FTPGet you can  specify which  remote  file(s) you  desire and
  39. where to  obtain them from, as commandline arguments, and  FTPGet will
  40. then go about  its business of transfering the specified files to your
  41. local machine - without your interaction.  Everything is automatic.
  42.  
  43. ======================================================================
  44.   FTPGet:                                                Chapter 2.0
  45. ======================================================================
  46.  
  47. FTPGet is  basically a FTP receive  tool that acts in roughly the same
  48. way as  the  'get' FTP session  instruction.  You specify  what  files
  49. you require, what name  they should  be given on  your  local  machine
  50. (with  restrictions - see later  for  more information), and where the
  51. files should be obtained from - FTPGet will do the rest.
  52.  
  53. ----------------------------------------------------------------------
  54.   FTPGet: Installation.                                  Chapter 2.1
  55. ----------------------------------------------------------------------
  56.  
  57. FTPGet is nothing other  than a  standard AmigaDOS Shell  command, and
  58. with that it  can be placed anywhere you  deem fit.  Probably the best
  59. location to  copy FTPGet  to is  AmiTCP's 'bin' directory, if  that is
  60. how your AmiTCP hierarchy  is configured.  Otherwise  the C: directory
  61. is  more than  adequate.  Placing  FTPGet somewhere  within your  path
  62. offers the obvious benefits.
  63.  
  64.   Alternatively, you may  wish to  make FTPGet  resident.  This can be
  65. achieved by the normal method of using AmigaDOS's  'Resident' command.
  66.  
  67. With  respect  to  stack  requirement, FTPGet  should  work just  fine
  68. with the default Shell stack size of 4096 bytes.
  69.  
  70. In  most cases, installation constitutes nothing more than copying the
  71. FTPGet  binary across to your favourite device, but there are  several
  72. features of  FTPGet that will require  extra  work before they can  be
  73. applied.  These "features" (for want  of a better  word) are  detailed
  74. below, and require the setting of several environment variables before
  75. FTPGet may apply them...
  76.  
  77. Because  commandline  arguments can  be a pain in  the butt at  times,
  78. especially if a  program requires many of them, FTPGet can  be made to
  79. rely  on  several  specific  environment  variables.  In  some  AmiTCP
  80. configurations most of  the below  variables may  already be  present,
  81. but I think it is best to detail them anyways. 
  82.  
  83.   USERNAME   - The name  of the currently  logged in user.  The  value
  84.                will usually be an  alias, as opposed to  the real name
  85.                of the user.  Eg,
  86.  
  87.                  setenv USERNAME "izzy"
  88.  
  89.                  This variable may  already have been set by the login
  90.                software of the local site.
  91.  
  92.   HOSTNAME   - The  name of the local machine  from which the transfer
  93.                session will be started.  Eg,
  94.  
  95.                  setenv HOSTNAME "ancient"
  96.  
  97.   DOMAINNAME - The  domain  where the machine is located.  Because the
  98.                HOSTNAME variable, as detailed above, contains the name
  99.                of the local  machine, the  DOMAINNAME variable doesn't
  100.                require  the host  name to be given.  The entry  should
  101.                still be prefixed with a '.' separator, though.  Eg,
  102.  
  103.                  setenv DOMAINNAME ".demon.co.uk"
  104.  
  105.   LOCALDIR   - FTPGet  relies on  the  need to know  where the  remote
  106.                files should  be transfered to  on the local  site.  In
  107.                most  cases, the local  file name  will be  issued as a
  108.                commandline argument, but this need not always be so.
  109.  
  110.                  The "LOCALDIR" variable  relates directly to the path
  111.                name where remote files will be written to, and it must
  112.                be terminated with either a '/', or a ':'.  Eg, 
  113.  
  114.                  setenv LOCALDIR "DATA:ARCHIVES/"
  115.                  setenv LOCALDIR "TRASH:"
  116.  
  117.                  FTPGet  will  use  the "LOCALDIR" variable  only if a
  118.                local  argument hasn't  been offered  at  the program's
  119.                outset.
  120.  
  121.   For the uninitiated, you set  any required  environment variables by
  122. using the  AmigaDOS 'SetEnv' command, which  should be located  within
  123. your system's C directory.
  124.  
  125.   Making use of the above environment variables effectly means you can
  126. reduce the size of the  commandline  you need  supply  to no more than
  127. two arguments at the most - best case scenario: anonymous FTP and only
  128. one transfer.
  129.  
  130. ----------------------------------------------------------------------
  131.   FTPGet: How to...?                                     Chapter 2.2
  132. ----------------------------------------------------------------------
  133.  
  134. FTPGet  requires  atleast two  arguments to be  passed  to it from the
  135. commandline: The Fully  Qualified  Domain Name, or IP  address, of the
  136. remote  site  you  wish  to FTP  from, and  the path and  file name of
  137. atleast one remote file that you wish the receive.
  138.  
  139.   Below are  listed all  the valid  commandline arguments FTPGet  will
  140. accept.
  141.  
  142.   SITE     - The FQDN, or IP address, of a remote FTP site.  All files
  143.              requested for transfer will, hopefully, be located here.
  144.  
  145.   USER     - The login name  to be given at the remote  site  when the
  146.              user  name has  been requested.  If this  argument  isn't
  147.              specified, the default  user name of  "anonymous" will be
  148.              assumed.
  149.  
  150.                If the user name is not accepted at the remote site you
  151.              may be notified and FTPGet will abort with the respective
  152.              error (see chapter 2.3).
  153.  
  154.   PASSWORD - Can also be abbrieviated to PASS at the commandline.
  155.  
  156.                When a  password is  requested  from the remote site at
  157.              login, the given  password  will be used  to satisfy that
  158.              request.
  159.  
  160.                If  you don't specify a password at  the commandline, a
  161.              password string will be made up for you by using both the
  162.              USERNAME, HOSTNAME and DOMAINNAME  environment  variables
  163.              that were discussed in chapter 2.1.
  164.  
  165.   ACCOUNT  - Can also be abbrieviated to ACT at the commandline.
  166.  
  167.                If the remote  FTP site requires a session account, the
  168.              accounting information that you specified for the ACCOUNT
  169.              argument  will  be  used.  If the  given  account is  not
  170.              valid at the remote site you may be  notified and the FTP
  171.              session will abort.
  172.  
  173.   CWD      - May also be specified as DIR.
  174.  
  175.                CWD acts in  exactly the  same way  as the CWD (Current
  176.              Working  Directory) FTP session  command.  Basically put,
  177.              all  files transfered will  be "pulled" from  the  remote
  178.              site  relative to  the given argument, where the argument
  179.              is a path at the remote FTP site.
  180.  
  181.                Applying the  CWD keyword can, in some  cases, cut down
  182.              the  required  length of the  commandline - and  that can 
  183.              only be a Good Thing.
  184.  
  185.   REMOTE   - This keyword  and its  argument must be  specified, or no
  186.              transfer will be possible.  Obvious really. ;o]
  187.  
  188.                From here, you tell  FTPGet which  file, or  files, you
  189.              wish  to FTP from the remote  FTP server.  Multiple files
  190.              may be specified, but two rules must be respected:
  191.  
  192.                1) If a LOCAL argument is given on the commandline (see
  193.                   below) that  constitutes a  file name, all  received
  194.                   files will be written locally under that name.  When
  195.                   FTP'ing multiple files, either make sure you specify
  196.                   a  directory  name as  the LOCAL argument, or ignore
  197.                   the LOCAL  argument totally.  See  the reference  to
  198.                   the LOCAL keyword for more information.
  199.  
  200.                2) If any  error occurs whilst the  transfer session is
  201.                   in progress, all pending transfers will be aborted.
  202.  
  203.   LOCAL    - The optional name that the remote file will be written as
  204.              when transfered to the local site.
  205.  
  206.                1) If  a fully  qualified path  name (a path name and a
  207.                   file name) is given as an argument, the file will be
  208.                   stored  locally under that name, no matter  what its
  209.                   remote name was.
  210.  
  211.                2) If  this argument is  a path name, the received file
  212.                   will be  written to the local path with the  name of
  213.                   the remote file.
  214.  
  215.                3) In the event  that no  LOCAL argument was  specified
  216.                   on the  commandline  and  the "LOCALDIR" environment
  217.                   variable  exists, the path name held  within will be
  218.                   used.  If the  environment  variable cannot be found
  219.                   the current directory will be used instead.  
  220.  
  221.             NOTE: Do NOT  fall into  the  trap of  specifying a  fully
  222.                   qualified  path name (a path  and a file  name) when
  223.                   you have  given multiple REMOTE  arguments!  The end
  224.                   result will be nothing less than wasted transfers on
  225.                   your  part, as each  subsiquently received file will
  226.                   overwrite the previous transfer!
  227.  
  228.   TEXT     - FTPGet will default to  a file type  of BINARY.  The TEXT
  229.              switch  (when  active) will tell  FTPGet to  receive  all
  230.              remote files as ASCII.
  231.  
  232.                As you have  probably  guessed, receiving "mixed"  file
  233.              types  is NOT possible.  If  you require  both BINARY and
  234.              ASCII you will  have  to initiate two  sessions - one for
  235.              each type.  Er, sorry.
  236.  
  237.   QUIET    - Just as  it says, don't bother  displaying any  output to
  238.              the  stdout.  FTPGet will return a  return code no matter
  239.              what happens, so typing "get rc" at the Shell will inform
  240.              you of FTPGet's success.
  241.  
  242.   A CTRL-C issued from the Shell  where FTPGet was  started will abort
  243. the current session.
  244.  
  245. ----------------------------------------------------------------------
  246.   FTPGet: Problems, problems.                            Chapter 2.3
  247. ----------------------------------------------------------------------
  248.  
  249. If, for  some  reason, FTPGet is unable to  perform its  duty - if the
  250. remote host  can't be found for example, a specific  return code shall
  251. be met.  The value of  the return code relates  directly to a specific
  252. error within FTPGet, these errors are listed below:
  253.  
  254.     0  - Everything went okay.  Not an error, but what the Hell.
  255.  
  256.     21 - Invalid arguments, in general.
  257.     22 - Invalid password argument. 
  258.     23 - Couldn't open bsdsocket.library
  259.     24 - Remote site doesn't exist.
  260.     25 - Remote server not responding/unavailable.
  261.     26 - User name not accepted at remote site.
  262.     27 - Password not accepted at remote site.
  263.     28 - Account not accepted at remote site.
  264.     29 - The remote file does not exist. 
  265.     30 - Cannot create the local file.
  266.     31 - Transfer aborted.  Transfer error, or user hit CTRL-C.
  267.  
  268. Error  specific return  codes can come  in very useful, especially  if
  269. FTPGet is to be ran from a script.
  270.  
  271. ======================================================================
  272.   Legalities... damn:                                    Chapter 3.0
  273. ======================================================================
  274.  
  275. You use FTPGet  completely at  your *own* risk, no  warranty is either
  276. expressed or implied.  I cannot (and will not) be held responsible for
  277. any  damages  caused  by  FTPGet, no  matter  what  the  circumstance.
  278. Either  use this program  or ignore it, but don't  blame me for  *any*
  279. unwanted  results.
  280.  
  281.   Although  FTPGet  is  freely  distributable, it  still  remains  the
  282. copyright  1995  Simon P. Dainty.  FTPGet  is  definitely  not  Public
  283. Domain, it is freely  distributable FreeWare - there  is a difference.
  284. Anyone wishing to obtain a copy has the right to a copy, for little or
  285. no charge.
  286.  
  287. Whilst  the continued  distribution  of FTPGet is  the  author's goal,
  288. he hopes that you will conform to the following agreement:
  289.  
  290.   1) No files  are added to, or removed from, the archive with respect
  291.      to the original distribution, and no  files are modified relative
  292.      to their original state without the author's prior permission.
  293.  
  294.   2) No charge, other than the cost of  media duplication and shipping
  295.      may be asked for this package unless the situation of that charge
  296.      falls within item three (below).
  297.  
  298.   3) If  this package is to be  included as a part  of a commercial or
  299.      ShareWare  (or  variant) distribution, or magazine coverdisk, the
  300.      author would appreciate some form of prior notification.
  301.  
  302.        Public Domain  compilations (CDs or floppy) are exempt from the
  303.      above requirement.  
  304.      
  305. If you  are a non-conformist, at least  make the  effort to appreciate
  306. what I've written above. =o)  Above all though, have fun.
  307.  
  308. ======================================================================
  309.   ...Forty Two:                                          Chapter 4.0
  310. ======================================================================
  311.  
  312. FTPGet was  written in C, with the aid of Matt Dillon's DICE C package
  313. (version 2.07.57R) and  was  tested on a 3.0-based  AGA Amiga, running
  314. AmiTCP v3.xbeta and bsdsocket.library version 2.
  315.  
  316. I'd like  to take this  opportunity to  thank Osma Ahvenlampi  for his
  317. help in beta testing FTPGet.  Mucho gracias amigo.
  318.  
  319. Even though  FTPGet  is freely  distributable, I'd like  you to  think
  320. of it as "World-a-Ware".  If you find  FTPGet to be useful, or you use
  321. FTPGet for any  period of time, please do  a little something to  help
  322. the  environment of OUR home.  We are  all  ultimately responsible for
  323. the world that we live in, and we are equally responsible for those we
  324. share  it  with.  We only have  the one copy  of Earth  and  without a
  325. back-up...
  326.  
  327. ----------------------------------------------------------------------
  328.   ...Forty Two: A word in your shell-like.               Chapter 4.1
  329. ----------------------------------------------------------------------
  330.  
  331. With respect to bug fixes, bug  reports, general  updates (if any) and
  332. pure talkability, I can  be contacted at any  of the addresses  listed
  333. below.  You will also find me lurking in most all of the Amiga related
  334. Usenet groups, specifically the  comp.sys.amiga.* groups as  well as a
  335. good few Amiga specific FidoNet and AmigaNet echos.
  336.  
  337.   Internet mailbox:
  338.  
  339.     ftpget@ancient.demon.co.uk (Simon Dainty)
  340.  
  341.   Or,
  342.  
  343.     izzy@ancient.demon.co.uk (Simon Dainty)
  344.  
  345.   FidoNet and AmigaNet, via Dox's Amiga BBS (+44 01943 850340):
  346.  
  347.     2:250/320.3 (Simon Dainty)
  348.     39:138/14.3    "     "
  349.  
  350.   IRC: Izzy/Si.
  351.  
  352.   Snail mail:
  353.  
  354.     25, Victor Road,
  355.     Heaton,
  356.     Bradford,
  357.     West Yorkshire.
  358.     BD9 4QN.
  359.     England.
  360.  
  361.   Electronic mail is my most preferred form of communication.
  362.  
  363.   SYL,
  364.  
  365.        Izzy.
  366.  
  367.  
  368.      "It's amazing - with the blink of an  eye, you  finally see
  369.       the light.  Oh-ho, it's amazing - when the moment arrives,
  370.       that you know  you'll be alright.  Yeah, it's amazing  and
  371.       I'm saying a prayer for the desparate hearts tonight..."
  372.  
  373.                                             - AeroSmith: Amazing.
  374.  
  375. ----------------------------------------------------------------------
  376.   ...Forty Two: Past, present and future.                Chapter 4.2
  377. ----------------------------------------------------------------------
  378.  
  379.   21-Feb-95:  
  380.  
  381.   v1.0 - Initial release with no know bugs.
  382.  
  383.   03-Mar-95:
  384.  
  385.   v1.1 - Added CWD  commandline keyword, which allows you to specify a
  386.          remote  directory  that relates to  the  base directory  from
  387.          where the given remote files will be addressed.
  388.  
  389.